{% if site.analytics.google.id %}
    <script type="text/javascript">
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
        ga('create', '{{ site.analytics.google.id }}', 'auto');
        ga('send', 'pageview');
    </script>
{% endif %}

{% if site.analytics.piwik.site_id %}
    <script type="text/javascript">
    var analyticsAPI = {
        id: '{{ site.analytics.piwik.site_id }}',
        url: '{{ site.analytics.piwik.api.url }}',
        token: '{{ site.analytics.piwik.api.token }}'
    };
    var _paq = _paq || [];
    _paq.push(["setDomains", ["*.irockbunny.com"]]);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function() {
        var u = "https://vps.irockbunny.com/analytics/";
        _paq.push(['setTrackerUrl', u + 'piwik.php']);
        _paq.push(['setSiteId', '{{ site.analytics.piwik.site_id }}']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
    })();
    </script>
    <noscript>
        <p><img src="https://vps.irockbunny.com/analytics/piwik.php?idsite={{ site.analytics.piwik.site_id }}&rec=1" style="border:0;" alt="Piwik Analytics" /></p>
    </noscript>
{% endif %}